package cn.iocoder.yudao.module.system.job.cp;

import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author pg
 * @project zysx
 * @description 同步部门和人员
 * @date 2024/10/11 11:31:07
 */
@Component
@Slf4j
public class UserDeptJob {

    @Resource
    private SyncService syncService;


    @XxlJob("syncUserDept")
    @TenantJob
    public void syncUserDept() throws WxErrorException {
        syncService.sync(); // 通过自注入的实例调用异步方法
    }
}
